package cn.iocoder.yudao.adminserver.franky.LRU;

import java.util.concurrent.atomic.AtomicLong;

/**
 * @Description: 静态内部类
 * @Author: franky
 * @CreateDate: 2021/4/19 1:30 下午
 * @Version: 1.0
 */
public class Singleton4 {
    private AtomicLong atomicLong = new AtomicLong(0);
    private Singleton4(){}

    private static class SingletonInstance {
        private static final Singleton4 instance = new Singleton4();
    }

    public static Singleton4 getInstance() {
        return SingletonInstance.instance;
    }

    public long getId() {
        return atomicLong.incrementAndGet();
    }
}
